//
//  MobNetworkingTool.m
//  Liuhe
//
//  Created by zr on 2018/8/17.
//  Copyright © 2018年 zr. All rights reserved.
//

#import "MobNetworkingTool.h"

@implementation MobNetworkingTool

+(instancetype)sharedTools{
    
    static MobNetworkingTool *instance;
    static dispatch_once_t onceToken;
    
    dispatch_once(&onceToken, ^{
        //基本的地址
        NSURLSessionConfiguration *config = [NSURLSessionConfiguration defaultSessionConfiguration];
        
        NSURL *url = [NSURL URLWithString:@"http://apicloud.mob.com"];
        
        instance = [[MobNetworkingTool alloc] initWithBaseURL:url sessionConfiguration:config];
        
        //设置超时时间
        config.timeoutIntervalForRequest = 10;
        
        instance.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json",@"text/json",@"text/javascript",@"text/html", @"image/jpeg",@"image/png", @"application/octet-stream",@"text/plain", nil];
        instance.requestSerializer = [AFHTTPRequestSerializer serializer];
        
        
    });
    
    return instance;
}

@end
